package cn.itcast.shiro.authentication;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/** 
* @author 作者 zhujf: 
* @version 创建时间：2017年8月1日 下午7:41:13 
* 
*/
public class test {

	public static void main(String[] args) {
		
		Calendar start = Calendar.getInstance();  
	    start.set(2014, 0, 11);  
	    Long startTIme = start.getTimeInMillis();  
	  
	    Calendar end = Calendar.getInstance();  
	    end.set(2014, 7, 11);  
	    Long endTime = end.getTimeInMillis();  
	  
	    Long oneDay = 1000 * 60 * 60 * 24l;  
	  
	    Long time = startTIme;  
	    while (time <= endTime) {  
	        Date d = new Date(time);  
	        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");  
	        System.out.println(df.format(d));  
	        time += oneDay;  
	    }  
		
	    //百分数计算
	    NumberFormat num = NumberFormat.getPercentInstance(); 
	    num.setMaximumIntegerDigits(3); 
	    num.setMaximumFractionDigits(2); 
	    double csdn = 0.09999; 
	    System.out.println(num.format(csdn));
		
	    double f = 0.78789;
	    DecimalFormat df = new DecimalFormat("#0.00");
	    System.out.println(df.format(f));
		
	}
}
